package com.nation.domain;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by dqd on 2017/11/14.
 */
@Entity
@Table(name = "T_country", schema = "show_nation", catalog = "")
public class TCountry  implements Serializable{
    private int id;
    private String country_code;
    private String country_name_e;
    private String countryNameZ;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "country_code", nullable = false, length = 3)
    public String getCountry_code() {
        return country_code;
    }

    public void setCountry_code(String country_code) {
        this.country_code = country_code;
    }

    @Basic
    @Column(name = "country_name_e", nullable = false, length = 20)
    public String getCountry_name_e() {
        return country_name_e;
    }

    public void setCountry_name_e(String country_name_e) {
        this.country_name_e = country_name_e;
    }

    @Basic
    @Column(name = "country_name_z", nullable = false, length = 100)
    public String getCountryNameZ() {
        return countryNameZ;
    }

    public void setCountryNameZ(String countryNameZ) {
        this.countryNameZ = countryNameZ;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TCountry tCountry = (TCountry) o;

        if (id != tCountry.id) return false;
        if (country_code != null ? !country_code.equals(tCountry.country_code) : tCountry.country_code != null)
            return false;
        if (country_name_e != null ? !country_name_e.equals(tCountry.country_name_e) : tCountry.country_name_e != null)
            return false;
        if (countryNameZ != null ? !countryNameZ.equals(tCountry.countryNameZ) : tCountry.countryNameZ != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (country_code != null ? country_code.hashCode() : 0);
        result = 31 * result + (country_name_e != null ? country_name_e.hashCode() : 0);
        result = 31 * result + (countryNameZ != null ? countryNameZ.hashCode() : 0);
        return result;
    }
}
